import java.util.Arrays;
import java.util.Scanner;

public class Main1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        Solution solution = new Solution();
        System.out.println(solution.maxFreqSum(s));
    }
}

class Solution {
    public int maxFreqSum(String s) {
        char[] array = s.toCharArray();
        int[] res = new int[26];
        for (int i = 0; i < array.length; i++) {
            res[array[i] - 'a']++;
        }
        int max1 = 0;
        int max2 = 0;
        for (int i = 0; i < 26; i++) {
            if(i == 0 || i == 4 || i == 8 || i == 14 || i == 20){
                if(res[i] > max1){
                    max1 = res[i];
                }
            }else{
                if(res[i] > max2){
                    max2 = res[i];
                }
            }
        }
        return max1 + max2;
    }
}